home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / What's New? / Development Kits / Speech Recognition Mgr 1.5b6 / SR 1.5b6 Interfaces & Lib / SpeechRecognition.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-22  |  21.2 KB  |  497 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        SpeechRecognition.h
  3.  
  4.      Contains:    Apple Speech Recognition Toolbox Interfaces.
  5.  
  6.      Version:    Technology:    PlainTalk 1.5
  7.  
  8.                  Release:    PlainTalk Developer Release
  9.  
  10.      Copyright:    © 1984-1996 by Apple Computer, Inc.
  11.  
  12.                  All rights reserved.
  13.  
  14.      Bugs?:        If you find a problem with this file, send the file and version
  15.                  information (from above) and the problem description to:
  16.  
  17.                      Internet:    apple.bugs@applelink.apple.com
  18.                      AppleLink:    APPLE.BUGS
  19.  
  20. */
  21. #ifndef __SPEECHRECOGNITION__
  22. #define __SPEECHRECOGNITION__
  23.  
  24. #ifndef __MEMORY__
  25. #include <Memory.h>
  26. #endif
  27.  
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31.  
  32. #if PRAGMA_IMPORT_SUPPORTED
  33. #pragma import on
  34. #endif
  35.  
  36. #if PRAGMA_ALIGN_SUPPORTED
  37. #pragma options align=mac68k
  38. #endif
  39.  
  40.  
  41. enum {
  42.     gestaltSpeechRecognitionVersion = 'srtb',
  43.     gestaltSpeechRecognitionAttr = 'srta'
  44. };
  45.  
  46.  
  47. enum {
  48.     gestaltDesktopSpeechRecognition = 1L << 0,
  49.     gestaltTelephoneSpeechRecognition = 1L << 1
  50. };
  51.  
  52. /* Error Codes [Speech recognition gets -5100 through -5199] */
  53.  
  54. enum {
  55.     kSRNotAvailable                = -5100,                        /* the service requested is not avail or applicable */
  56.     kSRInternalError            = -5101,                        /* a system internal or hardware error condition */
  57.     kSRComponentNotFound        = -5102,                        /* a needed system resource was not located */
  58.     kSROutOfMemory                = -5103,                        /* an out of memory error occurred in the toolbox memory space */
  59.     kSRNotASpeechObject            = -5104,                        /* the object specified is no longer or never was valid */
  60.     kSRBadParameter                = -5105,                        /* an invalid parameter was specified */
  61.     kSRParamOutOfRange            = -5106,                        /* when we say 0-100, don't pass in 101. */
  62.     kSRBadSelector                = -5107,                        /* an unrecognized selector was specified */
  63.     kSRBufferTooSmall            = -5108,                        /* returned from attribute access functions */
  64.     kSRNotARecSystem            = -5109,                        /* the object used was not a SRRecognitionSystem */
  65.     kSRFeedbackNotAvail            = -5110,                        /* there is no feedback window associated with SRRecognizer */
  66.     kSRCantSetProperty            = -5111,                        /* a non-settable property was specified */
  67.     kSRCantGetProperty            = -5112,                        /* a non-gettable property was specified */
  68.     kSRCantSetDuringRecognition    = -5113,                        /* the property can't be set while recognition is in progress -- do before or between utterances. */
  69.     kSRAlreadyListening            = -5114,                        /* in response to SRStartListening */
  70.     kSRNotListeningState        = -5115,                        /* in response to SRStopListening */
  71.     kSRModelMismatch            = -5116,                        /* no acoustical models are avail to match request */
  72.     kSRNoClientLanguageModel    = -5117,                        /* trying to access a non-specified SRLanguageModel */
  73.     kSRNoPendingUtterances        = -5118,                        /* nothing to continue search on */
  74.     kSRRecognitionCanceled        = -5119,                        /* an abort error occurred during search */
  75.     kSRRecognitionDone            = -5120,                        /* search has finished, but nothing was recognized */
  76.     kSROtherRecAlreadyModal        = -5121,                        /* another recognizer is modal at the moment, so can't set this recognizer's kSRBlockModally property right now */
  77.     kSRHasNoSubItems            = -5122,                        /* SRCountItems or related routine was called on an object without subelements -- e.g. a word -- rather than phrase, path, or LM. */
  78.     kSRSubItemNotFound            = -5123,                        /* returned when accessing a non-existent sub item of a container */
  79.     kSRLanguageModelTooBig        = -5124,                        /* Cant build language models so big */
  80.     kSRAlreadyReleased            = -5125,                        /* this object has already been released before */
  81.     kSRAlreadyFinished            = -5126,                        /* the language model can't be finished twice */
  82.     kSRWordNotFound                = -5127,                        /* the spelling couldn't be found in lookup(s) */
  83.     kSRNotFinishedWithRejection    = -5128,                        /* property not found because the LMObj is not finished with rejection */
  84.     kSRExpansionTooDeep            = -5129,                        /* Language model is left recursive or is embedded too many levels */
  85.     kSRTooManyElements            = -5130,                        /* Too many elements added to phrase or path or other langauge model object */
  86.     kSRCantAdd                    = -5131,                        /* Can't add given type of object to the base SRLanguageObject (e.g.in SRAddLanguageObject)    */
  87.     kSRSndInSourceDisconnected    = -5132,                        /* Sound input source is disconnected */
  88.     kSRCantReadLanguageObject    = -5133,                        /* An error while trying to create new Language object from file or pointer -- possibly bad format */
  89.                                                                 /* non-release debugging error codes are included here */
  90.     kSRNotImplementedYet        = -5199                            /* you'd better wait for this feature in a future release */
  91. };
  92.  
  93. /* Type Definitions */
  94. typedef struct OpaqueSRSpeechObject* SRSpeechObject;
  95. typedef SRSpeechObject SRRecognitionSystem;
  96. typedef SRSpeechObject SRRecognizer;
  97. typedef SRSpeechObject SRSpeechSource;
  98. typedef SRSpeechSource SRRecognitionResult;
  99. typedef SRSpeechObject SRLanguageObject;
  100. typedef SRLanguageObject SRLanguageModel;
  101. typedef SRLanguageObject SRPath;
  102. typedef SRLanguageObject SRPhrase;
  103. typedef SRLanguageObject SRWord;
  104. typedef unsigned long SRLanguageObjectFlags;
  105. /* between 0 and 100 */
  106. typedef unsigned short SRSpeedSetting;
  107. /* between 0 and 100 */
  108. typedef unsigned short SRRejectionLevel;
  109. /* When an event occurs, the user supplied proc will be called with a pointer    */
  110. /*    to the param passed in and a flag to indicate conditions such                */
  111. /*    as interrupt time or system background time.                                */
  112. struct SRCallBackStruct {
  113.     long                             what;                        /* one of notification flags */
  114.     long                             message;                    /* contains SRRecognitionResult id */
  115.     SRRecognizer                     instance;                    /* ID of recognizer being notified */
  116.     OSErr                             status;                        /* result status of last search */
  117.     short                             flags;                        /* non-zero if occurs during interrupt */
  118.     long                             refCon;                        /* user defined - set from SRCallBackParam */
  119. };
  120. typedef struct SRCallBackStruct SRCallBackStruct;
  121.  
  122. /* Call back procedure definition */
  123. typedef pascal void (*SRCallBackProcPtr)(SRCallBackStruct *param);
  124.  
  125. #if GENERATINGCFM
  126. typedef UniversalProcPtr SRCallBackUPP;
  127. #else
  128. typedef SRCallBackProcPtr SRCallBackUPP;
  129. #endif
  130.  
  131. enum {
  132.     uppSRCallBackProcInfo = kPascalStackBased
  133.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SRCallBackStruct *)))
  134. };
  135.  
  136. #if GENERATINGCFM
  137. #define NewSRCallBackProc(userRoutine)        \
  138.         (SRCallBackUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSRCallBackProcInfo, GetCurrentArchitecture())
  139. #else
  140. #define NewSRCallBackProc(userRoutine)        \
  141.         ((SRCallBackUPP) (userRoutine))
  142. #endif
  143.  
  144. #if GENERATINGCFM
  145. #define CallSRCallBackProc(userRoutine, param)        \
  146.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSRCallBackProcInfo, (param))
  147. #else
  148. #define CallSRCallBackProc(userRoutine, param)        \
  149.         (*(userRoutine))((param))
  150. #endif
  151. struct SRCallBackParam {
  152.     SRCallBackUPP                     callBack;
  153.     long                             refCon;
  154. };
  155. typedef struct SRCallBackParam SRCallBackParam;
  156.  
  157. /* Recognition System Types */
  158.  
  159. enum {
  160.     kSRDefaultRecognitionSystemID = 0
  161. };
  162.  
  163. /* Recognition System Properties */
  164.  
  165. enum {
  166.     kSRRejectedWord                = 'rejq',                        /* the SRWord used to represent a rejection */
  167.     kSRSeparationChars            = 'spch',                        /* separation chars for current dialect setting -- use pointer to SeparationChars struct, defined in Dialect.h */
  168.     kSRCleanupOnClientExit        = 'clup',                        /* Boolean: Default is true. The rec system and everything it owns is disposed when the client application quits */
  169.     kSRFeedbackAndListeningModes = 'fbwn'                        /* short: one of kSRNoFeedbackHasListenModes, kSRHasFeedbackHasListenModes, kSRNoFeedbackNoListenModes */
  170. };
  171.  
  172.  
  173. enum {
  174.     kSRNoFeedbackNoListenModes    = 0,                            /* next allocated recognizer has no feedback window and doesn't use listening modes    */
  175.     kSRHasFeedbackHasListenModes = 1,                            /* next allocated recognizer has feedback window and uses listening modes             */
  176.     kSRNoFeedbackHasListenModes    = 2                                /* next allocated recognizer has no feedback window but does use listening modes     */
  177. };
  178.  
  179. /* Speech Source Types */
  180.  
  181. enum {
  182.     kSRDefaultSpeechSource        = 0,
  183.     kSRLiveDesktopSpeechSource    = 'dklv',                        /* live desktop sound input */
  184.     kSRCanned22kHzSpeechSource    = 'ca22'                        /* AIFF file based 16 bit, 22.050 KHz sound input */
  185. };
  186.  
  187. /* Notification via Apple Event or Callback */
  188. /* Notification Flags */
  189.  
  190. enum {
  191.     kSRNotifyRecognitionBeginning = 1L << 0,                    /* recognition can begin. client must now call SRContinueRecognition or SRCancelRecognition */
  192.     kSRNotifyRecognitionDone    = 1L << 1                        /* recognition has terminated. result (if any) is available. */
  193. };
  194.  
  195. /* Apple Event selectors */
  196. /* AppleEvent message class  */
  197.  
  198. enum {
  199.     kAESpeechSuite                = 'sprc'
  200. };
  201.  
  202. /* AppleEvent message event ids */
  203.  
  204. enum {
  205.     kAESpeechDone                = 'srsd',
  206.     kAESpeechDetected            = 'srbd'
  207. };
  208.  
  209. /* AppleEvent Parameter ids */
  210.  
  211. enum {
  212.     keySRRecognizer                = 'krec',
  213.     keySRSpeechResult            = 'kspr',
  214.     keySRSpeechStatus            = 'ksst'
  215. };
  216.  
  217. /* AppleEvent Parameter types */
  218.  
  219. enum {
  220.     typeSRRecognizer            = 'trec',
  221.     typeSRSpeechResult            = 'tspr'
  222. };
  223.  
  224. /* SRRecognizer Properties */
  225.  
  226. enum {
  227.     kSRSearchStatusParam        = 'stat',                        /* see status flags below */
  228.     kSRNotificationParam        = 'noti',                        /* see notification flags below */
  229.     kSRCallBackParam            = 'call',                        /* type SRCallBackParam */
  230.     kSRAutoFinishingParam        = 'afin',                        /* automatic finishing applied on LM for search */
  231.     kSRForegroundOnly            = 'fgon',                        /* Boolean. Default is true. If true, client recognizer only active when in foreground.    */
  232.     kSRBlockBackground            = 'blbg',                        /* Boolean. Default is false. If true, when client recognizer in foreground, rest of LMs are inactive.    */
  233.     kSRBlockModally                = 'blmd',                        /* Boolean. Default is false. When true, this client's LM is only active LM; all other LMs are inactive. Be nice, don't be modal for long periods! */
  234.     kSRWantsResultTextDrawn        = 'txfb',                        /* Boolean. Default is true. If true, search results are posted to Feedback window */
  235.     kSRWantsAutoFBGestures        = 'dfbr',                        /* Boolean. Default is true. If true, client needn't call SRProcessBegin/End to get default feedback behavior */
  236.     kSRSoundInVolume            = 'volu',                        /* short in [0..100] log scaled sound input power. Can't set this property */
  237.     kSRReadAudioFSSpec            = 'aurd',                        /* *FSSpec. Specify FSSpec where raw audio is to be read (AIFF format) using kSRCanned22kHzSpeechSource. Reads until EOF */
  238.     kSRCancelOnSoundOut            = 'caso',                        /* Boolean: Default is true.  If any sound is played out during utterance, recognition is aborted. */
  239.     kSRSpeedVsAccuracyParam        = 'sped'                        /* SRSpeedSetting between 0 and 100 */
  240. };
  241.  
  242. /* 0 means more accurate but slower. */
  243. /* 100 means (much) less accurate but faster. */
  244.  
  245. enum {
  246.     kSRUseToggleListen            = 0,                            /* listen key modes */
  247.     kSRUsePushToTalk            = 1
  248. };
  249.  
  250.  
  251. enum {
  252.     kSRListenKeyMode            = 'lkmd',                        /* short: either kSRUseToggleListen or kSRUsePushToTalk */
  253.     kSRListenKeyCombo            = 'lkey',                        /* short: Push-To-Talk key combination; high byte is high byte of event->modifiers, the low byte is the keycode from event->message */
  254.     kSRListenKeyName            = 'lnam',                        /* Str63: string representing ListenKeyCombo */
  255.     kSRKeyWord                    = 'kwrd',                        /* Str255: keyword preceding spoken commands in kSRUseToggleListen mode */
  256.     kSRKeyExpected                = 'kexp'                        /* Boolean: Must the PTT key be depressed or the key word spoken before recognition can occur? */
  257. };
  258.  
  259. /* Operational Status Flags */
  260.  
  261. enum {
  262.     kSRIdleRecognizer            = 1L << 0,                        /* engine is not active */
  263.     kSRSearchInProgress            = 1L << 1,                        /* search is in progress */
  264.     kSRSearchWaitForAllClients    = 1L << 2,                        /* search is suspended waiting on all clients' input */
  265.     kSRMustCancelSearch            = 1L << 3,                        /* something has occurred (sound played, non-speech detected) requiring the search to abort */
  266.     kSRPendingSearch            = 1L << 4                        /* we're about to start searching */
  267. };
  268.  
  269. /* Recognition Result Properties */
  270.  
  271. enum {
  272.     kSRTEXTFormat                = 'TEXT',                        /* raw text in user supplied memory */
  273.     kSRPhraseFormat                = 'lmph',                        /* SRPhrase containing result words */
  274.     kSRPathFormat                = 'lmpt',                        /* SRPath containing result phrases or words */
  275.     kSRLanguageModelFormat        = 'lmfm'                        /* top level SRLanguageModel for post parse */
  276. };
  277.  
  278. /* SRLanguageObject Family Properties */
  279.  
  280. enum {
  281.     kSRSpelling                    = 'spel',                        /* spelling of a SRWord or SRPhrase or SRPath, or name of a SRLanguageModel */
  282.     kSRLMObjType                = 'lmtp',                        /* Returns one of SRLanguageObject Types listed below */
  283.     kSRRefCon                    = 'refc',                        /* 4 bytes of user storage */
  284.     kSREnabled                    = 'enbl',                        /* Boolean -- true if SRLanguageObject enabled */
  285.     kSROptional                    = 'optl',                        /* Boolean -- true if SRLanguageObject is optional    */
  286.     kSRRepeatable                = 'rptb',                        /* Boolean -- true if SRLanguageObject is repeatable */
  287.     kSRRejectable                = 'rjbl',                        /* Boolean -- true if SRLanguageObject is rejectable (Recognition System's kSRRejectedWord */
  288.                                                                 /*        object can be returned in place of SRLanguageObject with this property)    */
  289.     kSRPrimitive                = 'prim',                        /* Boolean -- determines what shows up in search result's list of primitives */
  290.     kSRRejectionLevel            = 'rjct',                        /* SRRejectionLevel between 0 and 100 */
  291.     kSRFinishingFlags            = 'finf'                        /* Please use kSROptional, kSRRepeatable, and kRejetable instead. pass pointer to SRLanguageObjectFlags. Being phased out of public interfaces. */
  292. };
  293.  
  294. /* LM Object Types -- returned as kSRLMObjType property of language model objects */
  295.  
  296. enum {
  297.     kSRLanguageModelType        = 'lmob',                        /* SRLanguageModel */
  298.     kSRPathType                    = 'path',                        /* SRPath */
  299.     kSRPhraseType                = 'phra',                        /* SRPhrase */
  300.     kSRWordType                    = 'word'                        /* SRWord */
  301. };
  302.  
  303. /* a normal and reasonable rejection level */
  304.  
  305. enum {
  306.     kSRDefaultRejectionLevel    = 50
  307. };
  308.  
  309. /* Finishing Flags - used to make up SRLanguageObjectFlags, which is used for kSRFinishingFlags and kSRAutoFinishingParam properties  */
  310. /* 4/10/95 These finishing flags are being phased out of the public interfaces.  Please use kSROptional, kSRRepeatable, */
  311. /*    and kSRRejectable Boolean SRLanguageObject properties instead.  Those Boolean properties are easier to use.            */
  312.  
  313. enum {
  314.                                                                 /* bit zero is reserved */
  315.     kSRAddPauses                = 1L << 1,                        /* allows user to pause between words */
  316.     kSRAddRejection                = 1L << 2,                        /* unrecognized words will be rejected */
  317.     kSRAddNoise                    = 1L << 3,                        /* allows a some noise at beginning or end of utterance */
  318.     kSRMakeOptional                = 1L << 4,                        /* contents of LM are optional */
  319.     kSRMakeRepeatable            = 1L << 5                        /* contents of LM may be repeated 0 or more times */
  320. };
  321.  
  322.  
  323. enum {
  324.     kSRAddWordSpotting            = (kSRAddRejection | kSRMakeRepeatable),
  325.     kSRDefaultFinishing            = kSRAddPauses,
  326.     kSRNoFinishing                = 0
  327. };
  328.  
  329. /********************************************************************************/
  330. /*                        NOTES ON USING THE API                                    */
  331. /*                                                                                */
  332. /*        All operations (with the exception of SRGetRecognitionSystem) are        */
  333. /*        directed toward an object allocated or begot from New, Get and Read        */
  334. /*        type calls.                                                                */
  335. /*                                                                                */
  336. /*        There is a simple rule in dealing with allocation and disposal:            */
  337. /*                                                                                */
  338. /*        *    all toolbox allocations are obtained from a SRRecognitionSystem        */
  339. /*                                                                                */
  340. /*        *    if you obtain an object via New or Get, then you own a reference     */
  341. /*            to that object and it must be released via SRReleaseObject when        */
  342. /*            you no longer need it                                                */
  343. /*                                                                                */
  344. /*        *    when you receive a SRRecognitionResult object via AppleEvent or        */
  345. /*            callback, it has essentially been created on your behalf and so        */
  346. /*            you are responsible for releasing it as above                        */
  347. /*                                                                                */
  348. /*        *    when you close a SRRecognitionSystem, all remaining objects which        */
  349. /*            were allocated with it will be forcefully released and any            */
  350. /*            remaining references to those objects will be invalid.                */
  351. /*                                                                                */
  352. /*        This translates into a very simple guideline:                            */
  353. /*            If you allocate it or have it allocated for you, you must release    */
  354. /*            it.  If you are only peeking at it, then don't release it.            */
  355. /*                                                                                */
  356. /********************************************************************************/
  357. /* Opening and Closing of the SRRecognitionSystem */
  358. extern pascal OSErr SROpenRecognitionSystem(SRRecognitionSystem *system, OSType systemID)
  359.  THREEWORDINLINE(0x303C, 0x0400, 0xAA56);
  360.  
  361. extern pascal OSErr SRCloseRecognitionSystem(SRRecognitionSystem system)
  362.  THREEWORDINLINE(0x303C, 0x0201, 0xAA56);
  363.  
  364. /* Accessing Properties of any Speech Object */
  365. extern pascal OSErr SRSetProperty(SRSpeechObject srObject, OSType selector, const void *property, Size propertyLen)
  366.  THREEWORDINLINE(0x303C, 0x0802, 0xAA56);
  367.  
  368. extern pascal OSErr SRGetProperty(SRSpeechObject srObject, OSType selector, void *property, Size *propertyLen)
  369.  THREEWORDINLINE(0x303C, 0x0803, 0xAA56);
  370.  
  371. /* Any object obtained via New or Get type calls must be released */
  372. extern pascal OSErr SRReleaseObject(SRSpeechObject srObject)
  373.  THREEWORDINLINE(0x303C, 0x0204, 0xAA56);
  374.  
  375. extern pascal OSErr SRGetReference(SRSpeechObject srObject, SRSpeechObject *newObjectRef)
  376.  THREEWORDINLINE(0x303C, 0x0425, 0xAA56);
  377.  
  378. /* Traversing SRRecognitionResult or LMObjects */
  379. extern pascal OSErr SRCountItems(SRSpeechObject container, long *count)
  380.  THREEWORDINLINE(0x303C, 0x0405, 0xAA56);
  381.  
  382. extern pascal OSErr SRGetIndexedItem(SRSpeechObject container, SRSpeechObject *item, long index)
  383.  THREEWORDINLINE(0x303C, 0x0606, 0xAA56);
  384.  
  385. extern pascal OSErr SRSetIndexedItem(SRSpeechObject container, SRSpeechObject item, long index)
  386.  THREEWORDINLINE(0x303C, 0x0607, 0xAA56);
  387.  
  388. extern pascal OSErr SRRemoveIndexedItem(SRSpeechObject container, long index)
  389.  THREEWORDINLINE(0x303C, 0x0408, 0xAA56);
  390.  
  391. /* SRRecognizer Instance Functions */
  392. extern pascal OSErr SRNewRecognizer(SRRecognitionSystem system, SRRecognizer *instance, OSType sourceID)
  393.  THREEWORDINLINE(0x303C, 0x060A, 0xAA56);
  394.  
  395. extern pascal OSErr SRStartListening(SRRecognizer instance)
  396.  THREEWORDINLINE(0x303C, 0x020C, 0xAA56);
  397.  
  398. extern pascal OSErr SRStopListening(SRRecognizer instance)
  399.  THREEWORDINLINE(0x303C, 0x020D, 0xAA56);
  400.  
  401. extern pascal OSErr SRSetLanguageModel(SRRecognizer instance, SRLanguageModel active)
  402.  THREEWORDINLINE(0x303C, 0x040E, 0xAA56);
  403.  
  404. extern pascal OSErr SRGetLanguageModel(SRRecognizer instance, SRLanguageModel *active)
  405.  THREEWORDINLINE(0x303C, 0x040F, 0xAA56);
  406.  
  407. extern pascal OSErr SRContinueRecognition(SRRecognizer instance)
  408.  THREEWORDINLINE(0x303C, 0x0210, 0xAA56);
  409.  
  410. extern pascal OSErr SRCancelRecognition(SRRecognizer instance)
  411.  THREEWORDINLINE(0x303C, 0x0211, 0xAA56);
  412.  
  413. extern pascal OSErr SRIdle(void )
  414.  THREEWORDINLINE(0x303C, 0x0028, 0xAA56);
  415.  
  416. /* Language Model Building and Manipulation Functions */
  417. extern pascal OSErr SRNewLanguageModel(SRRecognitionSystem system, SRLanguageModel *model, const void *name, Size nameLength)
  418.  THREEWORDINLINE(0x303C, 0x0812, 0xAA56);
  419.  
  420. extern pascal OSErr SRNewPath(SRRecognitionSystem system, SRPath *path)
  421.  THREEWORDINLINE(0x303C, 0x0413, 0xAA56);
  422.  
  423. extern pascal OSErr SRNewPhrase(SRRecognitionSystem system, SRPhrase *phrase, const void *text, Size textLength)
  424.  THREEWORDINLINE(0x303C, 0x0814, 0xAA56);
  425.  
  426. extern pascal OSErr SRNewWord(SRRecognitionSystem system, SRWord *word, const void *text, Size textLength)
  427.  THREEWORDINLINE(0x303C, 0x0815, 0xAA56);
  428.  
  429. /* Operations on any object of the SRLanguageObject family */
  430. extern pascal OSErr SRPutLanguageObjectIntoHandle(SRLanguageObject lobj, Handle lobjHandle)
  431.  THREEWORDINLINE(0x303C, 0x0416, 0xAA56);
  432.  
  433. extern pascal OSErr SRPutLanguageObjectIntoDataFile(SRLanguageObject lobj, short fRefNum)
  434.  THREEWORDINLINE(0x303C, 0x0328, 0xAA56);
  435.  
  436. extern pascal OSErr SRNewLanguageObjectFromHandle(SRRecognitionSystem system, SRLanguageObject *lobj, Handle lObjHandle)
  437.  THREEWORDINLINE(0x303C, 0x0417, 0xAA56);
  438.  
  439. extern pascal OSErr SRNewLanguageObjectFromDataFile(SRRecognitionSystem system, SRLanguageObject *lobj, short fRefNum)
  440.  THREEWORDINLINE(0x303C, 0x0427, 0xAA56);
  441.  
  442. extern pascal OSErr SREmptyLanguageObject(SRLanguageObject lobj)
  443.  THREEWORDINLINE(0x303C, 0x0218, 0xAA56);
  444.  
  445. extern pascal OSErr SRChangeLanguageObject(SRLanguageObject lobj, const void *text, Size textLength)
  446.  THREEWORDINLINE(0x303C, 0x0619, 0xAA56);
  447.  
  448. extern pascal OSErr SRAddLanguageObject(SRLanguageObject base, SRLanguageObject addon)
  449.  THREEWORDINLINE(0x303C, 0x041A, 0xAA56);
  450.  
  451. extern pascal OSErr SRAddText(SRLanguageObject base, const void *text, Size textLength, long refCon)
  452.  THREEWORDINLINE(0x303C, 0x081B, 0xAA56);
  453.  
  454. extern pascal OSErr SRRemoveLanguageObject(SRLanguageObject base, SRLanguageObject toRemove)
  455.  THREEWORDINLINE(0x303C, 0x041C, 0xAA56);
  456.  
  457. /* Utilizing the System Feedback Window */
  458. extern pascal OSErr SRProcessBegin(SRRecognizer instance, Boolean failed)
  459.  THREEWORDINLINE(0x303C, 0x031D, 0xAA56);
  460.  
  461. extern pascal OSErr SRProcessEnd(SRRecognizer instance, Boolean failed)
  462.  THREEWORDINLINE(0x303C, 0x031E, 0xAA56);
  463.  
  464. extern pascal OSErr SRSpeakAndDrawText(SRRecognizer instance, const void *text, Size textLength)
  465.  THREEWORDINLINE(0x303C, 0x061F, 0xAA56);
  466.  
  467. extern pascal OSErr SRSpeakText(SRRecognizer instance, const void *speakText, Size speakLength)
  468.  THREEWORDINLINE(0x303C, 0x0620, 0xAA56);
  469.  
  470. extern pascal OSErr SRStopSpeech(SRRecognizer recognizer)
  471.  THREEWORDINLINE(0x303C, 0x0223, 0xAA56);
  472.  
  473. extern pascal Boolean SRSpeechBusy(SRRecognizer recognizer)
  474.  THREEWORDINLINE(0x303C, 0x0224, 0xAA56);
  475.  
  476. extern pascal OSErr SRDrawText(SRRecognizer instance, const void *dispText, Size dispLength)
  477.  THREEWORDINLINE(0x303C, 0x0621, 0xAA56);
  478.  
  479. extern pascal OSErr SRDrawRecognizedText(SRRecognizer instance, const void *dispText, Size dispLength)
  480.  THREEWORDINLINE(0x303C, 0x0622, 0xAA56);
  481.  
  482.  
  483. #if PRAGMA_ALIGN_SUPPORTED
  484. #pragma options align=reset
  485. #endif
  486.  
  487. #if PRAGMA_IMPORT_SUPPORTED
  488. #pragma import off
  489. #endif
  490.  
  491. #ifdef __cplusplus
  492. }
  493. #endif
  494.  
  495. #endif /* __SPEECHRECOGNITION__ */
  496.  
  497.